package jinyilw.swing.visuals.Rcomp;

import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.plaf.basic.BasicMenuItemUI;
import java.awt.Dimension;

public class SeparatorItem2 extends JMenuItem
{
	private static final long serialVersionUID = 2812078142836748779L;

	@Override
	public void updateUI()
	{
		setUI(new SeparatorUI());
	}

	static class SeparatorUI extends BasicMenuItemUI
	{
		@Override
		public void installUI(JComponent c)
		{
			super.installUI(c);
			menuItem.setOpaque(false);
			menuItem.setBorderPainted(false);
		}

		@Override
		protected void installListeners()
		{
		}

		@Override
		protected Dimension getPreferredMenuItemSize(JComponent c,
				Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
		{
			return new Dimension(3, 3);
		}
	}
}
